//
//  AppDelegate.h
//  安好
//
//  Created by 冯凯 on 14-10-21.
//  Copyright (c) 2014年 lianchuangbrother. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <TencentOpenAPI/TencentOAuth.h>
#import "SRWebSocket.h"
#import "LaunchView.h"
#import "AHReach.h"
#import <AVFoundation/AVFoundation.h>

@class XHDrawerController;
@protocol ChatDelegate;
@protocol LogoutDelegate;
@interface AppDelegate : UIResponder <UIApplicationDelegate,WeiboSDKDelegate,WBHttpRequestDelegate,WXApiDelegate,SRWebSocketDelegate,LaunchViewDelegate,TencentSessionDelegate,UIAlertViewDelegate>

@property (strong, nonatomic) UIWindow *window;
#pragma - mark app的类方法
/**
 *  app的类方法
 *
 *  @return app的类方法
 */
+ (AppDelegate *)app;
#pragma - mark 微博登陆
/**
 *  微博的token
 */
@property (strong, nonatomic) NSString *wbtoken;
/**
 *  微博的usid
 */
@property (strong, nonatomic) NSString *wbusid;
/**
 *  微博的用户资料
 */
@property (strong, nonatomic) NSDictionary  * sinaUserDictionry;
/**
 *  websocket
 */
@property (strong, nonatomic) SRWebSocket *webSocket;
/**
 *  聊天消息的代理设置
 */
@property (nonatomic, strong) id<ChatDelegate>chatDelegate;
@property (nonatomic, strong) id<LogoutDelegate>logoutDelegate;
/**
 *  XGtoken
 */
@property (nonatomic,strong) NSData * tokenData;
/**
 *  初始化侧滑
 */
/**
 *  铃声播放
 */
@property(nonatomic,strong)AVAudioPlayer * player;
@property (nonatomic,strong) XHDrawerController *drawerController;
@property (nonatomic, assign) UIBackgroundTaskIdentifier background;
@property (nonatomic, strong) TencentOAuth * tencentOAuth;
@property(nonatomic, strong) NSArray *reaches;
@property (strong, nonatomic) UIView * wifiView;
@property (nonatomic, retain) NSTimer *heartBeatTimer;
@property (nonatomic, assign) BOOL resignActive;
@property (nonatomic,strong) NSString * udidString;

@property (assign ,nonatomic) BOOL  leftView;

- (void)viewShowWifiView;
- (void)viewHiddenWifiView;
- (void)WBSocket;

@end



#pragma mark 聊天的代理方法
@protocol ChatDelegate <NSObject>
/**
 *  收到即时通讯，发来的消息的代理方法
 *
 *  @param appD    单例AppDelegate
 *  @param message 即时消息
 */
-(void)receiveMessage:(AppDelegate *)appD Message:(id)message;
/**
 *  收到即时通讯，发来的远程推送消息代理方法
 *
 *  @param appD    单例AppDelegate
 *  @param message 推送消息
 */
-(void)receiveRemoteNotificationMessage:(AppDelegate *)appD Message:(id)message;
@end

@protocol LogoutDelegate <NSObject>
- (void)logoutAndskiptoMain:(NSString *)index;
@end
